<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
	<Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener" />
	<Listener className="org.apache.catalina.core.JasperListener" />
	<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
	<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
	<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

	<GlobalNamingResources>
		<Resource auth="Container" driverClassName="org.gjt.mm.mysql.Driver"
			type="javax.sql.DataSource" name="jdbc/rest-security" username="root"
			password="root" url="jdbc:mysql://localhost:3306/simple_service_book"
			validationQuery="select 1 from users" />
	</GlobalNamingResources>

	<Service name="Catalina">
		<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1"
			redirectPort="8443" />
		<Engine defaultHost="localhost" name="Catalina">

			<Realm className="org.apache.catalina.realm.DataSourceRealm"
				dataSourceName="jdbc/rest-security" userTable="users" userNameCol="user_name"
				userCredCol="user_pass" userRoleTable="user_roles" roleNameCol="role_name" />

			<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
				<Context docBase="security-rest" path="/security-rest" reloadable="true"
					source="org.eclipse.jst.j2ee.server:security-rest" />
			</Host>
		</Engine>
	</Service>
</Server>